package com.wangfei.swaggerdemo.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "首页",  description = "首页描述")
@RestController
@RequestMapping("/api")
public class IndexController {

    @Operation(summary = "首页资料", description = "获取首页资料")
    @GetMapping("/")
    public String index() {
        return "index";
    }

    @Operation(summary = "banner", description = "获取首页banner")
    @GetMapping("/banner")
    public String banner(
            @RequestParam(value = "name", required = false) @Parameter(description = "轮播图名称") String name) {
        System.out.println(name);
        return "banner";
    }
}
